
#include "SignalSlot.h"

using namespace mufun;

SIGNAL::SIGNAL()
    : pool_(new ThreadPool(4)), signals_(new SignalList)
{
    // downcasts_[SignalSign::ReadFile] = std::shared_ptr<DownCastT<ReadFileFuncType>>(new DownCastT<ReadFileFuncType>(SignalSign::ReadFile));
}

SIGNAL::~SIGNAL()
{
    signals_.reset();
    pool_.reset();
}

void SIGNAL::registerDownCast(const SignalSign &sign, const std::shared_ptr<DownCast> &downcast)
{
    auto it = downcasts_.find(sign);
    if (it == downcasts_.end())
    {
        downcasts_[sign] = downcast;
    }
    else
    {
    }
}